namespace Aesha.WoW.Broker.Migrations
{
    using System.Data.Entity.Migrations;
    
    public partial class v9 : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.ItemClass",
                c => new
                    {
                        ItemClassId = c.Int(nullable: false, identity: true),
                    })
                .PrimaryKey(t => t.ItemClassId);
            
            CreateTable(
                "dbo.ItemSubClasses",
                c => new
                    {
                        ItemSubClassId = c.Int(nullable: false),
                        ItemClassId = c.Int(nullable: false),
                        Name = c.String(maxLength: 255, unicode: false),
                    })
                .PrimaryKey(t => new { t.ItemSubClassId, t.ItemClassId })
                .ForeignKey("dbo.ItemClass", t => t.ItemClassId, cascadeDelete: true)
                .Index(t => t.ItemClassId);
            
        }
        
        public override void Down()
        {
            DropIndex("dbo.ItemSubClasses", new[] { "ItemClassId" });
            DropForeignKey("dbo.ItemSubClasses", "ItemClassId", "dbo.ItemClass");
            DropTable("dbo.ItemSubClasses");
            DropTable("dbo.ItemClass");
        }
    }
}
